EXEC=particle
INCLUDE= \
	-I/home/qtedq/cs277/chai3d-2.3.0/src \
	-I/home/qtedq/NVIDIA_GPU_Computing_SDK/CUDALibraries/common/inc \
	-I/home/qtedq/cs277/hapticuda/particle \
	-I/home/qtedq/cs277/hapticuda/fluid \
	-I/usr/local/cuda/include \
	-I/home/qtedq/NVIDIA_GPU_Computing_SDK/shared/inc

C_FLAGS= -D_LINUX -g
CC= nvcc
LD_FLAGS= -g
LIB= -ldhd -lchai3d -lusb-1.0 -lpthread -lGL -lGLU -lglut -lrt -lGLEW  -lcudart -lcutil_x86_64  -lshrutil_x86_64  -lparamgl_x86_64 
LIB_PATH= \
	-L/home/qtedq/cs277/chai3d-2.3.0/lib/lin-x86_64 \
	-L/home/qtedq/cs277/chai3d-2.3.0/external/DHD/lib/lin-x86_64\
	-L/usr/local/cuda/lib64 \
	-L/home/qtedq/cs277/hapticuda/lib\
	-L/home/qtedq/NVIDIA_GPU_Computing_SDK/shared/lib 

OBJDIR=obj


PARTICLE_SRC=$(wildcard *.cpp) 


PARTICLE_CUDA_SRC=$(wildcard *.cu) 


OBJ := $(PARTICLE_SRC:%.cpp=${OBJDIR}/%.o)

CUDA_OBJ := $(PARTICLE_CUDA_SRC:%.cu=${OBJDIR}/%.cu.o)\




all: $(EXEC)

$(EXEC): $(OBJ) $(CUDA_OBJ)
	$(CC) $(LD_FLAGS) $(LIB_PATH) $(LIB) $^ -o $@

${OBJDIR}/%.o: %.cpp
	$(CC) $(INCLUDE) $(C_FLAGS) -c  $< -o $@



${OBJDIR}/%.cu.o: %.cu
	$(CC) $(INCLUDE) $(C_FLAGS) -c  $< -o $@

clean:
	rm -f obj/*.o
	rm -f $(EXEC)

